# user-agent  cookies referer
import requests
# 导入ua池
from fake_useragent import UserAgent

# user-agent
# ua = UserAgent()
#
# url = 'http://127.0.0.1:8000/useragent/'
# response = requests.get( url, headers ={'User-Agent': ua.random} )
# print(response.text)



# cookies  是要有用户信息
# ua = UserAgent()
# url = 'http://127.0.0.1:8000/cookies/'
# cookies = {"csrftoken": "sjK803nC93xOy9XlXEgKuCuevW7p3kea"}
# response = requests.get( url,cookies=cookies )
# print(response.text)


# referer 是必须从某个地址 页面中才能进入另一个地址

url = 'http://127.0.0.1:8000/referer/'
headers = {'referer': 'http://127.0.0.1:8000'}
response = requests.get( url,headers=headers)
print(response.text)